<?php

include_once 'CodeObject.php';


/**
 * This is a parent class for other statement classes 
 * and should not be instantiated.
 * 
 * @package UC_PHPCodeModel
 * @author Uros Calakovic
 */

class Statement extends CodeObject
{
    public function __construct()
    {
        parent::__construct();
    }
    
    public function __set($name, $value)
    {
        parent::__set($name, $value);
        
        if($name == 'BlankLinesAfter')
        {
            $this->set_BlankLinesAfter($value);
        }
    }
    
    public function __get($name)
    {
        $ret = parent::__get($name);
        
        if($ret != null)
        {
            return $ret;
        }
        
        if($name == 'BlankLinesAfter')
        {
            return $this->get_BlankLinesAfter();
        }
    }
    
    public function get_BlankLinesAfter()
    {
        return $this->BlankLinesAfter;
    }

    public function set_BlankLinesAfter($BlankLinesAfter)
    {
        if(is_int($BlankLinesAfter) )
        {
            if($BlankLinesAfter >= 0)
            {
                $this->BlankLinesAfter = $BlankLinesAfter;
            }
            else
            {
                throw new InvalidArgumentException(
                    'The value should be greater or equal to zero.');
            }
        }
        else
        {
            throw new InvalidArgumentException(
                'The value should be an integer value.');
        }
    }

    private $BlankLinesAfter = 0;
}

?>
